<template>
	<view class="app-detail">
		<image class="detail-img" :src="imgUrl(info.bgimg)" mode="aspectFill"></image>

		<view class="info-wrapper">
			<text>{{info.branchname}}</text>
			<!-- 	<view class="tag-wrapper">
				<text class="tag-active">距您最近</text>
				<text>体检中心</text>
				<text>免费WiFi</text>
			</view> -->
			<view class="info-row">
				<image class="info-icon" :src="imgUrl('/uploads/20250811/0e7bdfb21c87c80dc1b880e7bca8119b.png')" mode="aspectFit"></image>
				<view class="row-wrapper">
					<text>{{info.business}}</text>
					<!-- <text>采血截止时间：10:30</text> -->
				</view>
				<view class="right-wrapper" @click="makePhoneCall()">
					<image class="right-icon" :src="imgUrl('/uploads/20250811/79288126a610c15c57783ff30b5667fd.png')" mode="aspectFill"></image>
					<text>电话</text>
				</view>
			</view>

			<view class="info-row">
				<image class="info-icon" :src="imgUrl('/uploads/20250811/498be8adbccbeaa7dbf874e642224808.png')" mode="aspectFill"></image>
				<view class="row-wrapper">
					<text>{{info.address}}</text>
					<!-- <text>采血截止时间：10:30</text> -->
				</view>
				<view class="right-wrapper" @click="goNavigation()">
					<image class="right-icon" :src="imgUrl('/uploads/20250811/379cadddde8ecc73a803c82c6209beb0.png')" mode="aspectFill"></image>
					<text>导航</text>
				</view>
			</view>
		</view>

	<!-- 	<view class="shop-list">
			<view class="list-header">
				<view class="header-left">
					<text>体检套餐</text>
					<view></view>
				</view>
			</view>

			<view class="list-content">
				<ShopList :data="[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]" />
			</view>
		</view> -->
	</view>
</template>
<script setup>
	import ShopList from "../../../components/shop-list/index";
	import {
		imgUrl
	} from "../../../utils/global";
	import {
		ref
	} from "vue";
	import {
		onLoad,
		onReady,
		onPullDownRefresh,
		onReachBottom
	} from '@dcloudio/uni-app';
	import {
		getbranchsInfo
	} from "@/api/hospital"
	const id = ref("")
	const info = ref({})
	onLoad((options) => {
		id.value = options.id
		getDetail()
	})
	const getDetail = () => {
		getbranchsInfo({
			id: id.value
		}).then(res => {
			info.value = res
		})
	}
	const goNavigation = () => {
		console.log(111)
		uni.getLocation({
			success: res => {
				console.log(res,"asdasd")
				uni.openLocation({
					latitude: parseFloat(info.value.latitude),
					longitude: parseFloat(info.value.longitude)
				})
			},
			fail: (err) => {
				console.log(err)
			}
		})
	}
	const makePhoneCall = () => {
		uni.makePhoneCall({
			phoneNumber: info.value.branchphone,
			success: () => {},
			fail: () => {}
		})
	}
</script>
<style src="./style.scss" scoped />